package com.itheima;

public class KeBianCanShu {
    public static void main(String[] args) {
        int[] arr = {11, 22, 33, 44, 55, 66};
        System.out.println(getSum(arr));

        int[] arr2 = {22, 33, 44, 55, 66, 77};
        int x = getSum(arr2);
        System.out.println("x = " + x);
    }

    public static int getSum(int... arr) {
        int sum = 0;
        for (int i = 0; i < arr.length; i++) {
            sum += arr[i];
        }

        return sum;
    }
}
